async function testCompress(originPath) {
    const originSize = await wx
        .getFileInfo({
            filePath: originPath,
        })
        .then((res) => res.size);
    const testTime = 10;
    const allPromise = [...Array(100 / testTime).keys()].map((i) => {
        return wx
            .compressImage({
                src: originPath,
                // 图片路径
                quality: i * testTime,
                // 压缩质量
            })
            .then((res) => res.tempFilePath)
            .then((path) => {
                return wx
                    .getFileInfo({
                        filePath: path,
                    })
                    .then((res) => ({
                        path,
                        quality: i * testTime,
                        size: res.size / 1000 + "K",
                        rate: 100 - (res.size * 100) / originSize,
                    }));
            });
    });
    const textResultArray = await Promise.all(allPromise);
    console.log("原始大小", originSize / 1000 + "K");
    console.table(textResultArray);
    const best = textResultArray.sort((final, cur) => {
        return final.size - cur.size;
    });
    console.log("最优解", best[0]);
}
